﻿using MES.Core;
using MES.Model.System;
using MES.Service.System.Menu;
using Microsoft.AspNetCore.Mvc;

namespace MES.API.Controllers.V2.System
{
    /// <summary>
    /// 菜单管理
    /// </summary>
    [Route("api/[controller]/[Action]")]
    [ApiVersion("2.0", Deprecated = false)]
    [ApiController]
    public class MenuController : ControllerBase
    {

        private readonly IMenuService _menuService;
        public MenuController(IMenuService menuService)
        {
            _menuService = menuService;
        }

        /// <summary>
        /// 添加用户角色
        /// </summary>
        /// <param name="role"></param>shuawobs
        /// <returns></returns>
        [HttpPost]
        public async Task<OperateResult> AddMenuAsync([FromBody] Sys_Menu role)
        {
            return await _menuService.AddMenuAsync(role);
        }
    }
}
